const cloud = require('wx-server-sdk');
cloud.init();

exports.main = async (event) => {
  const db = cloud.database();
  return await db.collection('dayplan').doc(event._id).update({
    data: {
      days: event.days,
      logs: event.logs
    }
  });
};